Technical details
library(GeoPressureR)
library(leaflet)
library(leaflet.extras)
library(raster)
library(dplyr)
library(ggplot2)
library(kableExtra)
library(plotly)
library(GeoLocTools)
setupGeolocation()
knitr::opts_chunk$set(echo = FALSE)
load(paste0("../data/1_pressure/", params$gdl_id, "_pressure_prob.Rdata"))
# load(paste0("../data/2_light/", params$gdl_id, "_light_prob.Rdata"))
load(paste0("../data/3_static/", params$gdl_id, "_static_prob.Rdata"))
load(paste0("../data/4_basic_graph/", params$gdl_id, "_basic_graph.Rdata"))
col <- rep(RColorBrewer::brewer.pal(8, "Dark2"), times = ceiling(max(pam$sta$sta_id) / 8))
All the results produced here are generated with (1) the raw geolocator data, (2) the labeled files of pressure and light and (3) the parameters listed below.
kable(gpr) %>% scroll_box(width = "100%")
| gdl_id | crop_start | crop_end | thr_dur | extent_N | extent_W | extent_S | extent_E | map_scale | map_max_sample | map_margin | prob_map_s | prob_map_s_calib | prob_map_thr | shift_k | kernel_adjust | calib_lon | calib_lat | calib_1_start | calib_1_end | calib_2_start | calib_2_end | calib_2_lon | calib_2_lat | prob_light_w | thr_prob_percentile | thr_gs | thr_as | low_speed_fix | ringNo | scientific_name | common_name | mass | wing_span | color |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| CB611 | 2021-06-15 | 2022-05-03 | 12 | 45 | -97 | 0 | -71 | 5 | 300 | 30 | 1 | NA | 0.9 | 0 | 1.4 | -91.19733 | 36.65001 | 2021-06-16 | 2021-09-15 | 2022-04-25 | 2022-05-03 | -91.19733 | 36.65001 | 0.1 | 0.9 | 120 | 100 | 15 | NA | Limnothlypis swainsonii | Swainson’s Warbler | NA | NA | NA |
The labeling of pressure data is illustrated with this figure. The black dots indicates the pressure datapoint not considered in the matching. Each stationary period is illustrated by a different colored line.
pressure_na <- pam$pressure %>%
mutate(obs = ifelse(isoutliar | sta_id == 0, NA, obs))
p <- ggplot() +
geom_line(data = pam$pressure, aes(x = date, y = obs), colour = "grey") +
geom_point(data = subset(pam$pressure, isoutliar), aes(x = date, y = obs), colour = "black") +
# geom_line(data = pressure_na, aes(x = date, y = obs, color = factor(sta_id)), size = 0.5) +
geom_line(data = do.call("rbind", shortest_path_timeserie) %>% filter(sta_id > 0), aes(x = date, y = pressure0, col = factor(sta_id))) +
theme_bw() +
scale_colour_manual(values = col) +
scale_y_continuous(name = "Pressure(hPa)")
ggplotly(p, dynamicTicks = T) %>% layout(showlegend = F)
sp_pressure <- do.call("rbind", shortest_path_timeserie) %>% filter(sta_id > 0)
sta_plot <- which(difftime(pam$sta$end, pam$sta$start, unit = "days") > 3)
par(mfrow = c(2, 3))
for (i in seq_len(length(sta_plot))) {
i_s <- sta_plot[i]
pressure_s <- pam$pressure %>%
filter(sta_id == i_s & !isoutliar)
err <- pressure_s %>%
left_join(sp_pressure, by = c("date","obs")) %>%
mutate(
err = obs - pressure - mean(obs - pressure, na.rm=T)
) %>%
.$err
hist(err, freq = F, main = paste0("sta_id=", i_s, " | ", nrow(pressure_s), " dtpts | std=", round(sd(err, na.rm=T), 2)))
xfit <- seq(min(err, na.rm=T), max(err, na.rm=T), length = 40)
yfit <- dnorm(xfit, mean = mean(err, na.rm=T), sd = sd(err, na.rm=T))
lines(xfit, yfit, col = "red")
}
| sta_id | start | end |
|---|---|---|
| 1 | 2021-06-16 19:42:28 | 2021-09-23 01:12:28 |
| 2 | 2021-09-23 10:42:28 | 2021-09-24 01:12:28 |
| 3 | 2021-09-25 03:42:28 | 2021-09-27 02:42:28 |
| 4 | 2021-09-27 06:12:28 | 2021-09-30 04:42:28 |
| 5 | 2021-09-30 05:12:28 | 2022-04-11 01:12:28 |
| 6 | 2022-04-11 15:12:28 | 2022-04-12 02:42:28 |
| 7 | 2022-04-12 06:12:28 | 2022-04-16 01:12:28 |
| 8 | 2022-04-16 05:12:28 | 2022-04-17 02:12:28 |
| 9 | 2022-04-17 04:12:28 | 2022-04-17 06:12:28 |
| 10 | 2022-04-17 06:42:28 | 2022-04-19 03:42:28 |
| 11 | 2022-04-19 04:12:28 | 2022-04-20 02:12:28 |
| 12 | 2022-04-20 07:42:28 | 2022-05-02 23:42:28 |